package com.af.security.auth.util.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.security.authentication.event.LogoutSuccessEvent;
import org.springframework.stereotype.Component;

/**
 * @author : zhenyun.su
 * @common : 监听登出成功， 触发执行
 * @since : 2020/6/24
 */

@Component
public class AfLogoutSuccessEventListener implements ApplicationListener<LogoutSuccessEvent> {
    private static final Logger logger = LoggerFactory.getLogger(AfLogoutSuccessEventListener.class);

    @Override
    public void onApplicationEvent(LogoutSuccessEvent logoutSuccessEvent) {
        logger.debug("onApplicationEvent, {}", logoutSuccessEvent.getAuthentication());
    }
}
